<section role="main" id="main">

    <noscript class="message black-gradient simpler">Your browser does not support JavaScript! Some features won't work as expected...</noscript>
    <hgroup id="main-title" class="thin">
        <h1>Registro de Chips</h1>
    </hgroup>
    <div class="with-padding">        
        <a href="javascript:void(0)" class="button orange-gradient glossy" id="btMuestraFormAsignaciones">SUBIR EXCEL ASIGNACIONES</a>
        <a href="javascript:void(0)" class="button green-gradient glossy" id="btMuestraFormActivaciones">SUBIR EXCEL ACTIVACIONES</a>
        <p>&nbsp;</p>
        <div id="muestraFormAsignaciones">
            <?php echo $this->Form->create('Chips', array('action' => 'guardaexcel', 'enctype' => 'multipart/form-data')); ?>
            <!--        <form method="post" action="" class="columns" onsubmit="return false">                               -->
            <!--<div class="new-row-desktop four-columns six-columns-tablet twelve-columns-mobile">-->
            <div class="new-row twelve-columns">                
                <!--                <h3 class="thin underline">&nbsp;</h3>                                          -->
                <fieldset class="fieldset fields-list">
                    <legend class="legend">Formulario Subida Excel Asignaciones</legend>
                    <div class="field-block button-height">							
                        <label for="login" class="label"><b>Seleccionar Excel :</b></label>
                        <?php //echo $this->Form->text('Persona.nombre', array('class' => 'span12', 'required')); ?>
                        <!--<input type="text" name="login" id="login" value="" class="input">-->
                        <span class="input file">
                            <span class="file-text"></span>
                            <span class="button compact">Seleccione</span>
                            <input type="file" name="data[Excel][excel]" id="special-input-1" value="" class="file withClearFunctions" multiple="" />
                        </span>
                    </div>                                                                 

                    <div class="field-block button-height">
                        <button type="submit" class="button glossy mid-margin-right">
                            <span class="button-icon"><span class="icon-tick"></span></span>
                            Guardar Excel
                        </button>

                        <button type="submit" class="button glossy">
                            <span class="button-icon red-gradient"><span class="icon-cross-round"></span></span>
                            Cancelar
                        </button>
                        &nbsp;
                        <button type="button" class="button glossy mid-margin-right" id="btMuestraFAsignaciones" onclick="openModal()"> 
                            <span class="button-icon"><span class="icon-search"></span></span>
                            Ver Formato
                        </button>
                    </div>                                        

                </fieldset>
            </div>
            </form>
        </div>

        <script>
                            function openModal()
                            {
                                //console.log('hizo click');
                                $.modal({
                                    title: 'Formato del Archivo',
                                    content: '<?php echo $this->Html->image('iconos/excelAsignados.png'); ?>',
                                    center: true
                                });
                            }
                            ;

        </script>

        <div id="muestraFormActivaciones" style="display: none;">
<?php echo $this->Form->create('Chips', array('action' => 'guardaexcelactivados', 'enctype' => 'multipart/form-data')); ?>
            <!--        <form method="post" action="" class="columns" onsubmit="return false">                               -->
            <!--<div class="new-row-desktop four-columns six-columns-tablet twelve-columns-mobile">-->
            <div class="new-row twelve-columns">                
                <!--                <h3 class="thin underline">&nbsp;</h3>                                          -->
                <fieldset class="fieldset fields-list">
                    <legend class="legend">Formulario Subida Excel Activaciones</legend>
                    <div class="field-block button-height">							
                        <label for="login" class="label"><b>Seleccionar Excel :</b></label>
<?php //echo $this->Form->text('Persona.nombre', array('class' => 'span12', 'required'));   ?>
                        <!--<input type="text" name="login" id="login" value="" class="input">-->
                        <span class="input file">
                            <span class="file-text"></span>
                            <span class="button compact">Seleccione</span>
                            <input type="file" name="data[Excel][excel]" id="special-input-1" value="" class="file withClearFunctions" multiple="" />
                        </span>
                    </div>                                                                 

                    <div class="field-block button-height">
                        <button type="submit" class="button glossy mid-margin-right">
                            <span class="button-icon"><span class="icon-tick"></span></span>
                            Guardar Excel
                        </button>

                        <button type="reset" class="button glossy">
                            <span class="button-icon red-gradient"><span class="icon-cross-round"></span></span>
                            Cancelar
                        </button>

                        <button type="button" class="button glossy mid-margin-right" onclick="openModal2();">
                            <span class="button-icon"><span class="icon-search"></span></span>
                            Ver Formato
                        </button>
                    </div>                                       

                </fieldset>
            </div>
            </form>
        </div>

        <script>
            $(document).ready(function() {
                $("#btMuestraFormAsignaciones").click(function() {
                    $("#muestraFormAsignaciones").show('slow');
                    $("#muestraFormActivaciones").hide('slow');
                });

                $("#btMuestraFormActivaciones").click(function() {
                    $("#muestraFormActivaciones").show('slow');
                    $("#muestraFormAsignaciones").hide('slow');
                });
            });

            function openModal2()
            {
                //console.log('hizo click');
                $.modal({
                    title: 'Formato del Archivo',
                    content: '<?php echo $this->Html->image('iconos/excelActivados.png'); ?>'
                });
            }
            ;
        </script>


        <table class="table responsive-table" id="sorting-advanced">

            <thead>
                <tr>                      
                    <th scope="col" width="15%" class="align-center hide-on-mobile">Nombre</th>
                    <th scope="col" width="15%" class="align-center hide-on-mobile">Fecha</th>
                    <th scope="col" width="15%" class="align-center hide-on-mobile-portrait">Tipo</th>                                         
                    <th scope="col" width="15%" class="align-center hide-on-mobile-portrait">Acciones</th> 
                </tr>
            </thead>          

            <tbody>
<?php foreach ($excels as $e): ?>
                    <tr>                      
                        <td><?php echo $e['Excel']['nombre_original']; ?></td>                        
                        <td><?php echo $e['Excel']['created']; ?></td>
                        <td><?php echo $e['Excel']['tipo']; ?></td>                       
                        <td>Detalle</td>                       
                    </tr>               
<?php endforeach; ?>
            </tbody>
        </table>

    </div>
</section>
<!-- Sidebar/drop-down menu -->
<?php echo $this->element('sidebar/almacenero'); ?>
<!-- End sidebar/drop-down menu -->